package com.example.mvvm

import com.example.mvvm.pokemon.net.NetHelper
import okhttp3.MediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody

class ErrorSender {
    private val url: String
    private val token: String
    private val client: OkHttpClient

    constructor(url: String, token: String) {
        this.url = url
        this.token = token
        this.client = NetHelper.defaultClient();
    }

    fun send(json:String){
        val request = Request.Builder().also {
            it.url("https://oapi.dingtalk.com/robot/send")
            it.post(json.toRequestBody())
        }.build()

    }

}